//
//  SDLoginLTView.m
//  SKinDiary
//
//  Created by pcyang on 16/7/10.
//  Copyright © 2016年 tencent. All rights reserved.
//

#import "SDLoginLTView.h"

@interface SDLoginLTView()
@end

@implementation SDLoginLTView
- (instancetype)initWithFrame:(CGRect)frame delegate:(id)delegate {
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = [UIColor colorWithRGB:0xffffff];
        _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, 50, self.height)];
        _nameLabel.textColor = [UIColor colorWithRGB:0xbcbec8];
        [_nameLabel setFont:[UIFont systemFontOfSize:13.f]];
        [self addSubview:_nameLabel];
        
        _textField = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, self.width - _nameLabel.right, self.height)];
        _textField.delegate = delegate;
        _textField.textColor = [UIColor colorWithRGB:0x87909a];
        [_textField setFont:[UIFont systemFontOfSize:13.f]];
        [self addSubview:_textField];
    }
    return self;
}

-(void)setName:(NSString *)name
{
    _nameLabel.text = name;
    [_nameLabel sizeToFit];
    _nameLabel.width = 74;
    _nameLabel.textAlignment = NSTextAlignmentRight;
    _nameLabel.top = (self.height - _nameLabel.height)/2;
    
    _textField.left = _nameLabel.right + 20;
}
@end
